<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:pe="http://primefaces.org/ui/extensions"
      xmlns:c="http://java.sun.com/jsf/composite/componentes">  
     
 	<body> 
 	    <ui:composition template="../resources/templates/tempListForm.xhtml">  
 	        
			<!--CABECALHO-->
     	 	<ui:define name="topoList">
			   <h:form>                 
				    <c:compTituloFilter classBean="#{luisBean}" 
				                        actionNovo="#{luisBean.novo()}"
				                        tituloImage="#{imageBean.imgLuis}"
				                        tituloText="#{msg['page-luis-list-titulo']}" 
				                        updateShowFilter=":formCorpo"
				                        buttonFilterVisible="false"
				                        dataTableExporter=":formCorpo:dataTable"/>   
    		    </h:form>                        
    		</ui:define>   
    		
    		<!--CORPO-->
    		<ui:define name="corpoList">
    		    
	       		<!-- GRID DADOS -->
	       		<h:form  id="formCorpo" > 
	       		
	       		    <!-- LOAD PAGE -->
		       	    <f:metadata>  
					    <f:event type="preRenderView" listener="#{luisBean.loadPage}"></f:event>  
				    </f:metadata>
				    
				     <!--MESSAGES -->
                    <p:growl id="growl" autoUpdate="true" showDetail="true" life="#{applicationBean.timeGrowl}"/>   
                      
                    <!-- COMPONENTE - CONFIRM DIALOG -->
				    <c:compConfirmDialog/>
				                         
				    <!-- FILTROS -->
				    <p:outputPanel id="panelFiltro">
				  	   	
	    			 	<div class="div-espaco-1"/>       	
	    			   <h:panelGrid columns="9" cellpadding="2" cellspacing="2" style="padding-left: 0px;" >	             
		                
		                                            
                          <!-- NOME -->  
                          <h:outputText value="#{msg['page-luis-list-nome']}" styleClass="data-texto-font" /> 
                          <c:compInputText textValue="#{luisBean.luisFilter.nome}" 
                                           textSize="100"
                                           textMaxLength="200"/>

		               
		                  <!-- BUSCAR  -->
		                  <p:commandButton value="#{msg['btn-value-buscar']}"  icon="ui-icon-search" 
					                       action="#{luisBean.buscarPorFiltro()}" update="dataTable"/>  
					                       
		             	</h:panelGrid>
					</p:outputPanel>
					
					<div class="div-espaco-1"/>                      
			        
	       		    <!--DATA TABLE  -->
				    <p:dataTable id="dataTable" var="luis" widgetVar="filterDataTable"
				                      value="#{luisBean.listLuis}"
				                      paginatorPosition="bottom" 
					                  paginator="true" 
					                  styleClass="data-table"
					                  tableStyle="width:auto"
                                      rows="#{applicationBean.recordsPerPage}"  
                                      emptyMessage="#{msg['datatable-msg-semregistro']}"
                                      selection="#{luisBean.listLuisSelecionados}"> 
                                      
					        <p:column selectionMode="multiple" exportable="false" 
					                  rendered="#{usuarioBean.permissaoExcluir() and !luisBean.isDomainFixed}"/>   
					        
					        <p:ajax event="rowSelect" listener="#{luisBean.onRowSelect}" update="dataTable"/>
					        <p:ajax event="rowSelectCheckbox" listener="#{luisBean.onRowSelect}" update="dataTable"/>
                     		<p:ajax event="rowUnselect" listener="#{luisBean.onRowUnSelect}" update="dataTable"/>
                     		<p:ajax event="rowUnselectCheckbox" listener="#{luisBean.onRowUnSelect}" update="dataTable"/> 
	                      
      					                              
                            <!-- NOME -->  
                            <p:column  styleClass="data-coluna-texto-font" style="text-align: left;  width: 100%;" 
                                       sortBy="#{luis.nome}" filterBy="#{luis.nome}" filterStyle="display: none;" >  
                                  <f:facet name="header"><h:outputText value="#{msg['page-luis-list-nome']}" /></f:facet>    
                                  <h:outputText value="#{luis.nome}" styleClass="data-texto-font" /> 
                            </p:column>

      					    
							<!--COLUNA VISUALIZAR-->
					        <p:column  headerText="" styleClass="data-coluna-icone"  
					                   exportable="false" style="width: 1%" >
					                   
					             <!--EXPORTAR-->     
					             <f:facet name="header">
					                 <c:compDataExporter dataTableExporter=":formCorpo:dataTable"
					                                     dataTableValue="#{luisBean.listLuis}"/>  
					             </f:facet>      
					                   
					             <p:commandButton id="btnVisualizar"
					                              action="#{luisBean.visualizar}" icon="ui-icon-visualizar" 
					                              style="height: 18px;" ajax="false">  
				                        <f:setPropertyActionListener value="#{luis}" target="#{luisBean.luis}" /> 
				                        <pe:tooltip for="btnVisualizar" value="#{msg['btn-title-visualizar']}" 
					                                    showEffect="fadeIn" hideEffect="fadeIn"/>       
				                 </p:commandButton>  
					        </p:column> 
      					    
							<!--COLUNA ALTERAR/EXCLUIR-->
					        <p:column rendered="#{usuarioBean.permissaoAlterar()}" 
					                  headerText="" styleClass="data-coluna-icone"  
					                  exportable="false" style="width: 1%" >
					             
					               <!--EXCLUIR-->     
					             <f:facet name="header">
					                  <p:commandButton id="btnExcluir" 
					                                    disabled="#{luisBean.isButtonDeleteDisabled}"
					                                   title="#{msg['btn-title-excluir']}" 
					                                   icon="ui-icon-trash" style="height: 18px;" ajax="true" 
					                                   actionListener="#{luisBean.excluir()}"
					                                   update="dataTable">  
					                       <pe:tooltip for="btnExcluir" value="#{msg['btn-title-excluir']}" 
					                                    showEffect="fadeIn" hideEffect="fadeIn"/> 
					                       <p:confirm header="Confirmação" message="#{msg['dlg-msg-body']}"  
					                                   icon="ui-icon-alert" />
				                      </p:commandButton>  
					             </f:facet>
					                  
					             <!--EDITAR-->       
					             <p:commandButton id="btnEditar"
					                              action="#{luisBean.editar}" icon="ui-icon-edit" 
					                              style="height: 18px;" ajax="true" >  
				                          <f:setPropertyActionListener value="#{luis}" target="#{luisBean.luis}" />
				                          <pe:tooltip for="btnEditar" value="#{msg['btn-title-editar']}" 
					                                       showEffect="fadeIn" hideEffect="fadeIn"/> 
				                 </p:commandButton>  
					        </p:column>  
	
				    </p:dataTable>
				    
				</h:form>   
    		</ui:define>   
    	</ui:composition> 
  	</body> 
</html>



